package com.the_last.controller;

import com.the_last.pojo.po.ProductCategory;
import com.the_last.service.ProductCategoryService;
import com.the_last.utils.Result;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/product-category")
@RequiredArgsConstructor
public class ProductCategoryController {
    
    private final ProductCategoryService productCategoryService;
    
    /**
     * 获取所有商品类别
     */
    @GetMapping("/list")
    public Result<List<ProductCategory>> getAllCategories() {
        return productCategoryService.getAllCategories();
    }
}